<?php
namespace app\models;

use yii;
use yii\db\Query;

class Login_log
{
    private $table;

    public function __construct()
    {
        $this->table = yii::$app->db->tablePrefix.'login_log';
    }

    public function insert($data)
    {
       return yii::$app->db->createCommand()->insert($this->table,$data)->execute();
    }

    public function get_login_list()
    {
        $db = new Query();
        $list = $db->select('*')->from($this->table)->orderBy(['time'=>SORT_DESC])->limit(100)->all();
        return $list;
    }
}